package com.ruoyi.member.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.member.mapper.FamilyVideoMapper;
import com.ruoyi.member.domain.FamilyVideo;
import com.ruoyi.member.service.IFamilyVideoService;

/**
 * 家庭视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyVideoServiceImpl implements IFamilyVideoService 
{
    @Autowired
    private FamilyVideoMapper familyVideoMapper;

    /**
     * 查询家庭视频
     * 
     * @param id 家庭视频主键
     * @return 家庭视频
     */
    @Override
    public FamilyVideo selectFamilyVideoById(Long id)
    {
        return familyVideoMapper.selectFamilyVideoById(id);
    }

    /**
     * 查询家庭视频列表
     * 
     * @param familyVideo 家庭视频
     * @return 家庭视频
     */
    @Override
    public List<FamilyVideo> selectFamilyVideoList(FamilyVideo familyVideo)
    {
        return familyVideoMapper.selectFamilyVideoList(familyVideo);
    }

    /**
     * 新增家庭视频
     * 
     * @param familyVideo 家庭视频
     * @return 结果
     */
    @Override
    public int insertFamilyVideo(FamilyVideo familyVideo)
    {
        familyVideo.setCreateTime(DateUtils.getNowDate());
        return familyVideoMapper.insertFamilyVideo(familyVideo);
    }

    /**
     * 修改家庭视频
     * 
     * @param familyVideo 家庭视频
     * @return 结果
     */
    @Override
    public int updateFamilyVideo(FamilyVideo familyVideo)
    {
        familyVideo.setUpdateTime(DateUtils.getNowDate());
        return familyVideoMapper.updateFamilyVideo(familyVideo);
    }

    /**
     * 批量删除家庭视频
     * 
     * @param ids 需要删除的家庭视频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyVideoByIds(Long[] ids)
    {
        return familyVideoMapper.deleteFamilyVideoByIds(ids);
    }

    /**
     * 删除家庭视频信息
     * 
     * @param id 家庭视频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyVideoById(Long id)
    {
        return familyVideoMapper.deleteFamilyVideoById(id);
    }
}
